
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<%- include('./_blocks/head', { siteTitle: themeConfig.siteName }) %>
</head>
<body class="post-template-default single single-post postid-70 single-format-standard">
    <div id="wrapper">
   
	<%- include('./_blocks/header') %>

		<div id="content" class="container">
			<div class="row">
	<div class="col-md-8 site-main" id="archives">
					

	<div class="wow bounceInLeft" id="archives-tags">
        <h3>标签云</h3>
<% site.tags.forEach(function(tag) { %>
               <a class="itags" href="<%= tag.link %>"><%= tag.name %></a>
               <% }); %>            
                        </div>


    <div class="wow bounceInRight" id="archives-content">
        <br>
		<% let years = []; posts.forEach((item) => { const year = item.date.substring(0, 4); if (!years.includes(year)) { years.push(year); } }); %>

                <div class="archive-title" >
					
            <div class="archives" >
				 <% years.forEach(function(year) { %>
                <h3><%- year %></h3>
					
					 <% posts.forEach(function(post) { %>
      <%if (post.date.indexOf(year) !== -1) { %>
                                    <div class="brick">
                        <a href="<%= post.link %>">
                            <span class="time"><%= post.dateFormat %></span> <%= post.title %>                        </a>
                    </div>
                            <% } %>
                             <% }); %>
							<% }); %>	
                            </div>
																	   
																   
        </div>
               
        

            </div>
		
		
			</div>
        
<nav class="navigation pagination" role="navigation">
		
		<% if (pagination.next) { %>												   
		<div class="nav-links nav-links2">
			
<a class="next page-numbers" href="<%= pagination.next %>">点击查看更多</a></div>
	<% } %>	
	</nav>	

			</div><!-- #end row-->
		</div><!-- #end container-->

		
		 <%- include('./_blocks/footer') %>

</div>

<%- include('./_blocks/footjs') %>
		<script type="text/javascript">
//点击加载更多
jQuery(document).ready(function($) {
    //点击下一页的链接(即那个a标签)
    $(' .next').click(function() {
        $this = $(this);
        $this.addClass('loading').text('正在努力加载'); //给a标签加载一个loading的class属性，用来添加加载效果
        var href = $this.attr('href'); //获取下一页的链接地址
        if (href != undefined) { //如果地址存在
            $.ajax({ //发起ajax请求
                url: href,
                //请求的地址就是下一页的链接
                type: 'get',
                //请求类型是get
                error: function(request) {
                    //如果发生错误怎么处理
                },
                success: function(data) { //请求成功
                    $this.removeClass('loading').text('点击查看更多'); //移除loading属性
                    var $res = $(data).find('.time-section '); //从数据中挑出文章数据，请根据实际情况更改
                    $('.archives').append($res.fadeIn(500)); //将数据加载加进posts-loop的标签中。
                    var newhref = $(data).find(' .next').attr('href'); //找出新的下一页链接
                    if (newhref != undefined) {
                        $('.next').attr('href', newhref);
                    } else {
                        $('.next').remove(); //如果没有下一页了，隐藏
                    }
                }
            });
        }
        return false;
    });
});
</script>
</body>
</html>
